<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargeRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharge_records', function (Blueprint $table) {
        	$table->float('total_amount', 10, 2)->comment('支付的金额');
        	$table->string('sn', 64)->comment('支付宝交易凭证号');
        	$table->string('auth_app_id', 32)->comment('授权方的appid，由于本接口暂不开放第三方应用授权，因此auth_app_id=app_id');
        	$table->string('app_id',32)->comment('开发者的appid');
        	$table->string('out_trade_no', 64)->comment('原支付请求的商户订单号');
        	$table->string('user_id',32)->comment('支付该账单的网站用户user id');
        	$table->integer('templet_id');
        	$table->enum('status', ['wait','success','fail','close']);
        	$table->enum('type', ['user','system']);
            $table->increments('id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recharge_records');
    }
}
